package 
{
	import mx.formatters.NumberBaseRoundType;
	import mx.formatters.NumberFormatter;
	
	public class NumberUtil
	{
		
		/********************
		* 숫자 천단위 콤마 구분
		* ******************/
		public static function NumberFormat(num:Number):String
		{
			if(isNaN(num) || num==0) {
				return "0";
			}
			else {
	        	var numberFormat:NumberFormatter = new NumberFormatter();
				//numberFormat.precision = 2;
				//numberFormat.rounding = NumberBaseRoundType.UP;
				var s:String = numberFormat.format(num); 
				
	            return s;
	 		}
		}
		
		public static function NumberFormatString(val:String):String
		{
			var num:Number = parseFloat(val);
			if(isNaN(num) || num==0) {
				return "0";
			}
			else {
				var numberFormat:NumberFormatter = new NumberFormatter();
				//numberFormat.precision = 2;
				//numberFormat.rounding = NumberBaseRoundType.UP;
				var s:String = numberFormat.format(num); 
				
				return s;
			}
		}
	}
}